
<%= render :partial => 'tags/tagcloud' %> 
<div id="multiple_tag">
	<%= link_to_remote "multiple tag" , 
		:url => {:action => "set_multiple_tag" , :comtroller => "resources"},
		:update => "multi_tag" %>
		
		<%= link_to_remote "no multiple tag" , 
		:url => {:action => "no_multiple_tag" , :comtroller => "resources"},
		:update => "multi_tag" %>
	<div id="multi_tag">
		<% if !(session[:multiple_tags]).nil? then %> SET <% else %> NOT SET <% end %>
	</div>
</div>
	<h1><% if !(session[:multiple_tags]).nil? then %> Multi Tag<% end %>
		<% if @resourceType %> <%= @resourceType %> <%end%>
		 Resources 
		 <% if @user %> for  <%= @user.username %> <% end %> 
		 <% if @tag then %>tagged with: 
		 	<% if !(session[:multiple_tags]).nil? then %> 
		 		<% for tag_id in session[:multiple_tags] %>
		 			'<%= (Tag.find(tag_id)).name %>'
		 		<% end %>
		 		
		 	<% else %>
		 		'<%= @tag.name %>'
			 <% end %>
		 <% end %>
	</h1>


<% for resource in @resources %>

<a name="res_<%= resource.id.to_s %>"></a>
	<div id="res_<%= resource.id.to_s %>" class="resource">
		<span id="res_title"><%= link_to resource.title, resource.link, :popup=>true %></span>
			
		<%= resource.voting_interface %>

		<p class="description"><b>Description: </b><%=h resource.displayShortDescription %></p>

		
    	<%= link_to 'Show', resource %>
    	<%= link_to 'Edit', edit_resource_path(resource) %>
    	<%= link_to 'add to favorites', :action => "addFavoriteResource" , :controller => "resources", :user_id => session[:user_id] , :id => resource.id %>

		<!-- ADD COMMENT //-->
		<div id="comment_<%= resource.id.to_s %>">		
			<%= link_to_remote('Leave a comment', 
				:update=>"comment_"+resource.id.to_s, 
				:url=>{:controller=>"comments", :action=>"show_comment_input", :res_id=>resource.id},
				:success=>visual_effect(:slide_down, "comment_"+resource.id.to_s)
				) %>
		</div>
		<!-- READ COMMENTS //-->
		<div id="r_comment_<%= resource.id.to_s %>"  class="r_comments">		
			<u><%= link_to_remote('Read comments', 
				:update=>"r_comment_"+resource.id.to_s, 
				:url=>{:controller=>"comments", :action=>"show_comments_of", :res_id=>resource.id},
				:success=>visual_effect(:slide_down, "r_comment_"+resource.id.to_s)
				) %></u>
		</div>
		there are <%= Comment.countComments(resource.id) %> comments
		<div id = "tags">
			<b>Tags:</b>
    		<% tags = resource.showResourceTags() %>
			<% for tag in tags %>
    		<%= link_to tag.name, :controller => "resources" , :action => "index" , :tag_id => tag.id %> |
		<% end %>
		</div> 
			<!--<%=h resource.user_id %>-->
	</div>


<% end %>

<br />

<%= link_to 'New resource', new_resource_path %>

